Skip to content

Clone WebRTC session descriptions on the signaling thread - #1749

Open
lucastcox wants to merge 1 commit into
livekit:mainfrom
lucastcox:fix/sdp-signaling-thread
Open

lucastcox wants to merge 1 commit into
livekit:mainfrom
lucastcox:fix/sdp-signaling-thread

Conversation

@lucastcox

Copy link
Copy Markdown

WebRTC’s peer connection getters return borrowed session description pointers. WebRTC documents that they may only be dereferenced on the signaling thread. The native wrappers currently call Clone() on the caller’s thread, where a concurrent description update can leave them copying a stale pointer. WebRTC API contract

Run the lookup and clone together on the existing signaling thread for all six getters. The wrapper still returns an owned copy or an empty pointer when a description is unavailable.

The peer-connection test now checks for absent descriptions before negotiation and verifies that the copies remain usable after the peer connection closes. All 31 libwebrtc unit tests passed on Linux with Clang 21 and Rust 1.97.1.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T18:52:36.411021Z db5ac29 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants